package com.zijin.exec;

public class Text01 {
    public static void main(String[] args) {
        int[] a = {1, 2, 3, 4, 5, 6, 7, 8};
        int count = 0;
        int sum = 0;
        for (int num : a) {
            if (num % 2 == 0) {
                count++;
                sum += num;
            }
        }
        double average = sum / count;
        System.out.println("偶数个数: " + count);
        System.out.println("偶数平均值: " + average);
    }
}
